package org.report4service.views;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import org.report4service.utils.CommandPool;
import org.report4service.utils.TextPool;

/**
 * About Vendor form.
 * @author Jmpango
 */
public class AboutForm extends  Form implements CommandListener {

    /** Reference to which form to display */
    private Display display;

    /** Reference to the previous Screen/Form */
    private Displayable prvScreen;
    
    public AboutForm(Display display, Displayable prvScreen){
        super(TextPool.TITLE());
        setDisplay(display);
	setPrvScreen(prvScreen);

        append( new StringItem("Service Report v1.0",
                "\nCopyright (C) 2012\nDesigned By: Mpango Jonathan\n\nDrop me an email:\n" +
                "r4s2012@gmail.com\n\n------\nHELP\n------\n"+
                "Select button: Enables you to enter hrs,mins,rVisits etc.\n"+
                "Edit button: Enables you to edit your report.\n"+
                "Report button: Enables you to enter your monthly report.\n"+
                "Setting button: Enables you to change your password\n"));

        this.addCommand(CommandPool.btnBack);
        this.setCommandListener(this);
        
        getDisplay().setCurrent(this);
    }

    public void commandAction(Command command, Displayable d) {
        if(command.equals(CommandPool.btnBack)){
            getDisplay().setCurrent(getPrvScreen());
        }
    }

    public Display getDisplay() {
        return display;
    }

    public void setDisplay(Display display) {
        this.display = display;
    }

    public Displayable getPrvScreen() {
        return prvScreen;
    }

    public void setPrvScreen(Displayable prvScreen) {
        this.prvScreen = prvScreen;
    }

}
